#ifndef __Sequence_h_
#define  __Sequence_h_


#include <QMap>
#include "GloveStructs.h"

class QXmlStreamWriter;
class QDomElement;

namespace vkbrd
{
	class Sequence
	{
		gInt combination;
		
		int action;

	public:

		inline bool operator == (const Sequence& _s) const
		{
			return (_s.combination == this->combination &&
							_s.action == this->action);
		}

		//!too big number to indicate undefined sequence
		static const gInt illegalValue = 0xFFF; 

		Sequence(gInt _combination, int _action);

		Sequence(QDomElement& _sequenceElement);

		Sequence();

		static QMap<int, QString>	vKeyNames;

		static void init();

		bool match(gInt _seq);

		bool match(Sequence& _seq);

		bool match(BoolFingers _seq);

		bool undefined();

		int getSetFlagsCount();

		int getAction(){return action;}

		int getCombination(){return combination;}

		void serialize( QXmlStreamWriter* _writer );

		static const QString sequenceXmlElementName;
	};
} //namespace vkbrd

#endif __Sequence_h_